import { ReferType, TimeStamp } from "./common";

export interface Dictionary extends TimeStamp {
    _id: string;
    title: string;
    key: string;
    status: boolean;
    remark?: string;
    dictItems: DictionaryItem[] | ReferType;
}

export interface DictionaryItem {
    _id: string;
    label: string;
    value: string;
    backgroundColor?: string;
    status: boolean;
    sort: number;
    remark?: string;
}

export type CreateDictionaryReq = Omit<Dictionary, "_id"> & {
    dictItems: Omit<DictionaryItem, "_id">[];
};

export type UpdateDictionaryReq = Partial<Dictionary> & {
    _id: string;
    dictItems?: Omit<DictionaryItem, "_id">[];
};

export type CreateDictionaryItemReq = Omit<DictionaryItem, "_id"> & { dictionaryId: string };

export type UpdateDictionaryItemReq = DictionaryItem;
